package cn.neusoft.service.impl;

import cn.neusoft.domain.Order;
import cn.neusoft.domain.Substation;
import cn.neusoft.mapper.OrderMapper;
import cn.neusoft.service.OrderService;
import org.mockito.internal.matchers.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    @Transactional
    @Override
    public List<Order> findAll() {
        return orderMapper.findAll();
    }

    @Transactional
    @Override
    public void add(Order order){
        orderMapper.add(order);
    }

    @Transactional
    @Override
    public List<Order> findByStatus(String status){
        return orderMapper.findByStatus(status);
    }

    @Transactional
    @Override
    public List<Order> findById(String id) {
        return orderMapper.findById(id);
    }

    @Transactional
    @Override
    public List<Order> findByReceiverName(String name) {
        return orderMapper.findByReceiverName(name);
    }

    @Transactional
    @Override
    public List<Order> findByConsigneeName(String name) {
        return orderMapper.findByConsigneeName(name);
    }

    @Override
    public List<Substation> findAllfz() {
        return orderMapper.findAllfz();
    }

    @Override
    @Transactional
    public List<Order> findByType(String status) {
        return orderMapper.findByType(status);
    }


}
